﻿using Abp.Domain.Entities.Auditing;
using Hicap.QRCodeWarehouse.Core.Models.Other;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Hicap.QRCodeWarehouse.Core.Models.DbSet
{
    public class GenerationTask : FullAuditedEntity
    {
        [Required]
        [ForeignKey("Product")]
        public int ProductId { get; set; }

        public Product Product { get; set; }

        public int Amount { get; set; }

        [Required]
        public GenerationRuleType CodeType { get; set; }

        [Required]
        public GenerationStatus Status { get; set; }

        [Required]
        public GenerationTaskType @Type { get; set; }

        public string CronExpression { get; set; }

        [Required]
        public int SubordinateCompanyId { get; set; }

        public bool IsActive { get; set; } = true;

        public DateTime? TriggeredTime { get; set; } = null;
    }
}